package com.muyu.danmo.domain.mapstruct;

import com.muyu.danmo.domain.DanmoInformationCopy1;
import com.muyu.danmo.domain.DanmoInformationMapTitle;
import com.muyu.danmo.domain.DanmoPersonInfo;
import com.muyu.danmo.domain.DanmoPersonPosition;
import com.muyu.danmo.domain.dto.PersonAddDTO;
import com.muyu.danmo.domain.dto.PersonBaseInfoDTO;
import com.muyu.danmo.domain.dto.PersonPositionDTO;
import com.muyu.danmo.domain.dto.PositionInfoDTO;
import com.muyu.danmo.domain.es.PersonInfoEs;
import com.muyu.danmo.domain.vo.PersonBaseInfoVO;
import com.muyu.danmo.domain.vo.PersonInfoVO;
import com.muyu.danmo.domain.vo.PersonPositionInfoVO;
import lombok.Builder;
import org.mapstruct.*;

import java.util.List;

/**
 * @author Administrator
 */

@Mapper(
        componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        // 新增以下配置
        unmappedSourcePolicy = ReportingPolicy.WARN,
        mappingInheritanceStrategy = MappingInheritanceStrategy.AUTO_INHERIT_FROM_CONFIG// 可选：全局配置
)
public interface PersonMapper {

    DanmoPersonInfo to(PersonAddDTO personAddDTO);

    DanmoPersonPosition to(PersonPositionDTO personPositionDTO);

    PersonInfoVO to(DanmoPersonInfo danmoPersonInfo);

    List<PersonPositionInfoVO> to(List<DanmoPersonPosition> list);

    @Mappings({
            @Mapping(target = "associationId", source = "association"),
            @Mapping(target = "associationTypeId", source = "associationType"),
    })
    PersonBaseInfoDTO to(DanmoInformationCopy1 danmoInformationCopy1);


    PositionInfoDTO toDTO(DanmoInformationCopy1 danmoInformationCopy1);

//    List<PersonBaseInfoVO> toList(List<PersonInfoEs> list);

    PersonBaseInfoVO to(PersonInfoEs personInfoEs);




}
